import { Form } from '@douyinfe/semi-ui'

interface ICTextAreaForm {
  field?: string
  label?: string
  required?: boolean
  maxCount?: number
  rows?: number
}

export default function CTextAreaForm(props: ICTextAreaForm) {
  return (
    <Form.TextArea
      rules={
        props.required
          ? [{ required: true, message: `请输入${props.label}` }]
          : undefined
      }
      field={props.field ? props.field : 'remark'}
      autosize
      rows={props.rows ? props.rows : 2}
      showClear
      maxCount={props.maxCount === undefined ? 300 : props.maxCount}
      label={props.label ? props.label : '备注'}
    />
  )
}
